<template>
	<Layout>
		<template #title>信息管理</template>
		<scroll-refresher>
			<view class="iflex column aic fill" style="padding-top: 30rpx;">
				<view v-for="item of list" :key="item.lawFirmId" class="iflex info-item">
					<image class="info-item__image" :src="item.lawFirmLogo"></image>
					<view class="iflex column jcsb info-item__lawyer">
						<text>{{item.lawFirmName}}</text>
						<view class="iflex aic fill">
							<view class="ellipsis">
								<view class="iflex aic jcc intro-tag">简介</view>
								{{item.lawFirmDesc}}
							</view>
						</view>
					</view>
					<view class="iflex info-item__button">
						<u-button :customStyle="{width:'96rpx'}" type="primary" shape="circle"
							@click.stop="tapEdit(item)">编辑</u-button>
					</view>
				</view>
			</view>
		</scroll-refresher>
	</Layout>
</template>

<script setup lang="ts">
	import { onLoad } from '@dcloudio/uni-app';
	import { ref } from 'vue';
	import { useGetDataPaging } from '@/hooks/paging';
	import { getLawfirmList } from '@/apis/lawfirm';

	const { list, refresh, tolower } = useGetDataPaging({
		api: getLawfirmList,
		params: () => {
			return {

			}
		}
	});

	onLoad(() => {
		refresh();
	});

	function tapEdit(item) {
		uni.navigateTo({
			url: '/pages-lawyer/lawyer-detail/lawyer-detail'
		})
	}

	function tapEditLaw() {
		uni.navigateTo({
			url: '/pages-lawyer/law-detail/law-detail'
		})
	}
</script>

<style lang="scss">
	.info-item {
		width: 688.34rpx;
		height: 190rpx;
		padding: 30rpx 0 40rpx 0;
		border-bottom: 1px solid #dde4f170;


		&__image {
			width: 120rpx;
			height: 120rpx;
			border-radius: 18rpx;
		}

		&__lawyer {
			width: 520rpx;
			padding: 3rpx 0;
			margin-left: 28rpx;

			text {
				color: #000000;
				font-size: 30rpx;
				font-weight: 400;
			}

			view {
				color: #727683;
				font-size: 24rpx;
				font-weight: 400;

				.intro-tag {
					margin-right: 16rpx;
					width: 64rpx;
					height: 32rpx;
					line-height: 20rpx;
					border-radius: 4rpx;
					background: #FBE8DA;
					color: #ff710a;
					font-size: 20rpx;
					font-weight: 400;
				}
			}
		}

		&__button {
			position: absolute;
			right: 0;
		}
	}
</style>